segy2grd

segy2grd(cmd0::String="", arg1=nothing; kwargs...)

Create a grid file from a SEGY file.

(Warning: Manual translate by Claude. Needs revision)

Description

segy2grd reads an IEEE SEGY file and creates a binary grid file. Either a simple mapping (equivalent to xyz2grd -Z) or a more complicated averaging where a particular grid cell includes values from more than one sample in the SEGY file can be done. segy2grd will report if some of the nodes are not filled in with data. Such unconstrained nodes are set to a value specified by the user [Default is NaN]. Nodes with more than one value will be set to the average value.

Required Arguments

segyfile An IEEE floating point SEGY file. Traces are all assumed to start at 0 time/depth (passed as first argument or via cmd0).

  • G or outgrid or save : – outgrid=filename
    Give the name of the output grid file.

  • I or inc or increment or spacing : – inc=x_inc | inc=(x_inc, y_inc) | inc=“xinc[+e|n][/yinc[+e|n]]”
    Specify the grid increments or the block sizes. More at spacing

  • R or region or limits : – limits=(xmin, xmax, ymin, ymax) | limits=(BB=(xmin, xmax, ymin, ymax),) | limits=(LLUR=(xmin, xmax, ymin, ymax),units=“unit”) | …more
    Specify the region of interest. More at limits. For perspective view view, optionally add zmin,zmax. This option may be used to indicate the range used for the 3-D axes. You may ask for a larger w/e/s/n region to have more room between the image and the axes.

Optional Arguments

  • A or add or count : – add=:z | add=:n | add=true
    Add up multiple values that belong to the same node (same as add=:z). Use add=:n to simply count the number of data points that were assigned to each node. [Default (no add option) will calculate mean value]. Not used for simple mapping.

  • D or metadata or header : – metadata=string
    Set grid metadata (title, remark, x/y/z units, etc.).

  • L or nsamp or nsamples : – nsamples=val
    Let nsamp override number of samples in each trace.

  • M or ntraces : – ntraces=val
    Fix number of traces to read in. Default tries to read 10000 traces. ntraces=0 will read number in binary header, ntraces=n will attempt to read only n traces.

  • Q or adjust : – adjust=(xscale=val, sint=val)
    Can be used to change two different settings:
    xscale (or x): applies scalar x-scale to coordinates in trace header to match the coordinates specified in region.
    sint (or y): specifies sample interval as s_int if incorrect in the SEGY file.

  • S or spacing or varspacing : – spacing=:c | spacing=:o | spacing=(byte=num,)
    Set variable spacing; use :c (or :cdp) for cdp, :o (or :offset) for offset, or a NamedTuple with byte=num for 4-byte float starting at byte num. If spacing not set, assumes even spacing of samples at the x_inc, y_inc supplied with inc.

  • V or verbose : – verbose=true | verbose=level
    Select verbosity level. More at verbose

  • bi or binary_in : – binary_in=??
    Select native binary format for primary table input. More at

  • di or nodata_in : – nodata_in=val
    Examine all input columns and if any item equals val we interpret this value as a missing data item and substitute the value NaN. Also sets nodes with no input SEGY coverage to this value [Default is NaN].

  • r or reg or registration : – reg=:p | reg=:g
    Select gridline or pixel node registration. Used only when output is a grid. More at

  • yx : – yx=true
    Swap 1st and 2nd column on input and/or output.

Examples

To create a grid file from an even spaced SEGY file test.segy, try:

using GMT
G = segy2grd("test.segy", inc="0.1/0.1", outgrid="test.nc", region=(198,208,18,25), verbose=true)

Note that this will read in 18-25s (or km) on each trace, but the first trace will be assumed to be at X=198.

To create a grid file from the SEGY file test.segy, locating traces according to the CDP number, where there are 10 CDPs per km and the sample interval is 0.1, try:

using GMT
G = segy2grd("test.segy", outgrid="test.nc", region=(0,100,0,10), inc="0.5/0.2",
             verbose=true, adjust=(xscale=0.1, sint=0.1))

Because the grid interval is larger than the SEGY file sampling, the individual samples will be averaged in bins.

Precompiling packages...


  58970.2 msGMT

  1 dependency successfully precompiled in 60 seconds. 80 already precompiled.

Source Code

This function has multiple methods:

See Also